package com.iplant.mes.service.mesenum.andon;

import com.iplant.base.po.enums.BaseEnum;

/**
 * 设备状态（看板）
 *
 * @author YouWang·Peng
 * 2024-1-3 14:44:08
 */
public enum AndonDeviceStatusTypes implements BaseEnum {
    /**
     * 关机
     */
    Default(0, "关机", ""),
    /**
     * 开机
     */
    PowerOn(1, "开机", ""),
    /**
     * 运行
     */
    Run(2, "运行", ""),
    /**
     * 停止
     */
    Stop(4, "停止", ""),
    /**
     * 已完工
     */
    EmergencyStop(8, "急停", ""),
    /**
     * 报警
     */
    Alarm(16, "报警", ""),
    /**
     *手动
     */
    Hand(32, "手动", ""),
    /**
     *自动
     */
    Automatic(64, "自动", ""),
    /**
     *调试
     */
    Test(128, "调试", "");

    private int value;
    private String label;
    private String remark;

    AndonDeviceStatusTypes(int value, String label, String remark) {
        this.value = value;
        this.label = label;
        this.remark = remark;
    }

    /**
     * 通过 value 的数值获取枚举实例
     *
     * @param val int
     * @return BCMRuleItemTypes
     */
    public static AndonDeviceStatusTypes getEnumType(int val) {
        for (AndonDeviceStatusTypes type : AndonDeviceStatusTypes.values()) {
            if (type.getValue() == val) {
                return type;
            }
        }
        return Default;
    }

    public int getValue() {
        return value;
    }

    public String getLabel() {
        return label;
    }

    @Override
    public void setValue(int wValue) {
        this.value = wValue;
    }

    @Override
    public void setLabel(String wLabel) {
        this.label = wLabel;
    }

    public String getRemark() {
        return remark;
    }

    @Override
    public void setRemark(String remark) {
        this.remark = remark;
    }
}
